package pers.cz.config;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport;
import springfox.documentation.builders.ApiInfoBuilder;
import springfox.documentation.builders.PathSelectors;
import springfox.documentation.builders.RequestHandlerSelectors;
import springfox.documentation.service.Contact;
import springfox.documentation.spi.DocumentationType;
import springfox.documentation.spring.web.plugins.Docket;
import springfox.documentation.swagger2.annotations.EnableSwagger2;

/**
 * 文档管理配置
 * @program: PostGirl-panent
 * @description: Swagger2
 * @author: Cheng Zhi
 * @create: 2021-02-27 23:34
 **/
@Configuration
@EnableSwagger2
public class Swagger2Config {
    @Bean
    Docket docket() {
        return new Docket(DocumentationType.SWAGGER_2)
                .select()
                .apis(RequestHandlerSelectors.basePackage("pers.cz.controller"))
                .paths(PathSelectors.any())
                .build()
                .apiInfo(new ApiInfoBuilder()
                        .description("接口文档描述信息")
                        .title("PostGirl接口文档")
                        .contact(new Contact("Chengzhi","http://www.PostGirl.com","1803472613@qq.com"))
                        .version("v1.0")
                        .license("Apache2.0")
                        .build()
                );
    }

}
